package com.sixbro.shiro.uaa.filter;

import javax.servlet.Filter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *
 * </p>
 *
 * @Author: Mr.Lu
 * @Since: 2020/6/19 17:07
 */
public class ModularCustomFilter {

    private List<CustomFilterWrapper> filterWrappers = new ArrayList<CustomFilterWrapper>();

    public Map<String, Filter> getFilters() {
        Map<String, Filter> filterMap = new HashMap<String, Filter>();
        for (CustomFilterWrapper filterWrapper : filterWrappers) {
            filterMap.put(filterWrapper.getName(), filterWrapper.getFilter());
        }
        return filterMap;
    }

    public void setFilterWrappers(List<CustomFilterWrapper> filterWrappers) {
        this.filterWrappers = filterWrappers;
    }
}
